<layout name="page" />
<block name="content">
	{:widget('page_header/simple',array('name'=>'新建待办事项'))}
	<div class="frame">
		<form method='post' id="form_data" name="form_data" enctype="multipart/form-data"   >
			<input type="hidden" id="ajax" name="ajax" value="1">
			<input type="hidden" id="status" name="status" value="1">
			<input type="hidden" id="opmode" name="opmode" value="add">
			<div class="box">
				<label class="input-label" for="name">标题*：</label>
				<input value="" class="input" type="text" id="name" name="name" check="required" info="请输入标题">
			</div>
			<div class="box">
				<label class="input-label" for="end_date">结束：</label>
				<input  type="text" id="end_date" name="end_date" readonly="readonly" class="input input-date" value="" readonly="readonly">
			</div>
			<div class="box">
				<label class="input-label" >优先级：</label>
				<select name="priority" class="select w10">
					<option value="">请选择</option>
					<option value="3">高</option>
					<option value="2">一般</option>
					<option value="1">低</option>
				</select>
				<i class="icon"></i>
			</div>
			<div class="box">
				<label class="input-label" for="name">附件：</label>
				{:widget('file_upload/add')}
			</div>
			<div class="box">
				<label class="input-label" for="name">内容：</label>
				<textarea class="simple" id="content" name="content" style="width:100%;height:200px;"></textarea>
			</div>
			<div class="box">
				<label class="input-label" ></label>
				<a class="btn btn-normal" onclick="save()">保存</a>
				<a class="btn btn-return" onclick="go_return_url();">取消</a>
			</div>
		</form>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		layui.use(['global', 'editor', 'uploader'], function() {
			var $ = layui.jquery;
			var fn = {
				save : function() {
					send_form("form_data", "{:url('save')}", "{:url('index')}", function(ret) {
						if (ret.status) {
							layer.msg(ret.info, {
								time : 1200
							}, function() {
								location.href = "{:url('index')}";
							});
						} else {
							layer.msg(ret.info);
							return false;
						}
					});
				}
			};
			win_exp(fn);
		});

	</script>
</block>